﻿<Window x:Class="tomenglertde.ResXManager.View.Visuals.InputBox"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:styles="urn:ResXManager.Styles"
        xmlns:toms="urn:TomsToolbox"
        ShowInTaskbar="False" 
        SizeToContent="WidthAndHeight" 
        ResizeMode="NoResize"
        WindowStyle="SingleBorderWindow"
        FocusManager.FocusedElement="{Binding ElementName=TextBox}"
        Style="{DynamicResource {x:Static styles:ResourceKeys.WindowStyle}}"
        DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}">
  <StackPanel Width="400">
    <StackPanel Margin="10,20">
      <TextBlock Text="{Binding Prompt}" TextWrapping="Wrap" />
      <Decorator Height="10" />
      <TextBox x:Name="TextBox" HorizontalAlignment="Stretch" Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource {x:Static styles:ResourceKeys.TextBoxStyle}}" />
      <Decorator Height="10" />
    </StackPanel>
    <Grid Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
      <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.IsSharedSizeScope="True" Margin="10">
        <Button Padding="12,3" IsDefault="True"
                Command="{Binding CommitCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
                Style="{DynamicResource {x:Static styles:ResourceKeys.ButtonStyle}}">
          <ContentControl Style="{StaticResource {ComponentResourceKey TypeInTargetAssembly=toms:ResourceKeys, ResourceId={x:Static toms:ResourceKeys.SharedWidthContainerStyleKeyName}}}" Content="OK" HorizontalContentAlignment="Center" />
        </Button>
        <Decorator Width="10" />
        <Button Padding="12,3" IsCancel="True"
                Style="{DynamicResource {x:Static styles:ResourceKeys.ButtonStyle}}">
          <ContentControl Style="{StaticResource {ComponentResourceKey TypeInTargetAssembly=toms:ResourceKeys, ResourceId={x:Static toms:ResourceKeys.SharedWidthContainerStyleKeyName}}}" Content="Cancel" HorizontalContentAlignment="Center" />
        </Button>
      </StackPanel>
    </Grid>
  </StackPanel>
</Window>